
var app = angular.module('iswitch', []);
//var iswitchAppControllers = angular.module('iswitchAppControllers',[]);

var url = '/api/directory';
app.factory('SwitchFactory', function ($http, $location) {
    return {
        get: function (id) {
                
            return $http.get(url + '/' + id);
           
        },
        add: function (jsonrequest) {
            return $http.post(url, jsonrequest);
        },
        delete: function (customer) {
            return $http.delete(url + customer.CustomerID);
        },
        update : function (polygon) {
            return $http.put(url + polygon.PolygonID, polygon);
        }
    };
});
